feat(sdk): add gateway utility helpers for CLI and bot consumers#1012
feat(sdk): add gateway utility helpers for CLI and bot consumers#1012
Conversation
- Add getInnerQuote() to unwrap discriminated GatewayQuote union - Add InnerQuote type (union of onramp/offramp/layerZero quotes) - Add ScureBitcoinSigner re-export from utils for direct PSBT signing - Add MempoolClient.getAddressMempoolTxs for mempool tx monitoring - Export getBalance and estimateTxFee from wallet utilities These helpers support the upcoming gateway-cli tool and other bot consumers that need lower-level access to quote discrimination and Bitcoin signing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a set of new utility helpers primarily aimed at supporting CLI tools and bot consumers. The changes enhance the SDK's capabilities by providing more flexible Bitcoin private key handling, simplifying the discrimination of various gateway quote types, and enabling direct monitoring of unconfirmed Bitcoin transactions in the mempool. These additions streamline common operations for developers interacting with the gateway and Bitcoin network. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several new utilities and features to the SDK. It adds static methods to ScureBitcoinSigner for creating signers from WIF or auto-detected private key formats, and exports these along with a new BitcoinSigner type. A new getInnerQuote function is added to unwrap GatewayQuote objects, with a suggestion to improve its type safety by removing unnecessary type casts. Additionally, a getAddressMempoolTxs method is added to MempoolClient to fetch pending transactions for a Bitcoin address, and getAddressInfo and AddressType are now exported from bitcoin-address-validation for enhanced address validation capabilities.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
getInnerQuote()to unwrap discriminatedGatewayQuoteunion using generated type guardsInnerQuotetype (union of onramp/offramp/layerZero quotes)ScureBitcoinSignerre-export fromutils/for direct PSBT signingMempoolClient.getAddressMempoolTxsfor mempool tx monitoringgetBalanceandestimateTxFeefrom wallet utilitiesThese helpers support the upcoming
gateway-clitool (PR #1005) and other bot consumers that need lower-level access to quote discrimination and Bitcoin signing.Test plan
pnpm exec tsc --noEmitpassespnpm testpasses (49 passed, 11 skipped)🤖 Generated with Claude Code